package org.xtense.data;

/**
 * 
 * @author Goodtiger
 *
 */
public abstract class DBConfig {
	protected String driver;
	protected String url;
	protected String username;
	protected String password;
	
	protected String getDriver() {
		return driver;
	}

	protected String getUrl() {
		return url;
	}

	protected String getUsername() {
		return username;
	}

	protected String getPassword() {
		return password;
	}
	
	public static DBConfig getInstance(boolean isFromFile, String[] config) {
		if(isFromFile) {
			return new DBConfigFromFile();
		} else {
			if(config != null ) {
				return new DBConfigFromUI(config);
			} else {
				return new DBConfigFromUI();
			}
		}
	}

}
